<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>项目进度对比分析</title>
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .container {
            width: 95%;
            max-width: 1000px;
            background-color: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            padding: 30px;
            animation: fadeIn 0.8s ease-out;
        }

        header {
            text-align: center;
            margin-bottom: 30px;
        }

        h1 {
            font-size: 2.2rem;
            color: #2c3e50;
            margin-bottom: 10px;
            background: linear-gradient(90deg, #3498db, #2c3e50);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }

        .subtitle {
            font-size: 1.1rem;
            color: #7f8c8d;
            max-width: 600px;
            margin: 0 auto;
            line-height: 1.6;
        }

        .chart-container {
            height: 500px;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            background: white;
        }

        .legend {
            display: flex;
            justify-content: center;
            gap: 30px;
            margin-top: 20px;
            font-size: 1.1rem;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .legend-color {
            width: 25px;
            height: 15px;
            border-radius: 3px;
        }

        .controls {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 25px;
        }

        button {
            padding: 12px 25px;
            font-size: 1.1rem;
            background: linear-gradient(to right, #3498db, #2c3e50);
            color: white;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }

        button:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @media (max-width: 768px) {
            .container {
                padding: 15px;
            }

            h1 {
                font-size: 1.8rem;
            }

            .chart-container {
                height: 400px;
            }
        }
    </style>
</head>

<body>
    <div class="container">
   

        <div class="chart-container" id="main"></div>


    </div>

    <script>
        // 初始化图表
        const chartDom = document.getElementById('main');
        const myChart = echarts.init(chartDom);

        // 示例数据

        // 配置项
        //下面就是上图的配置项，关键部分有注释
        option = {
            title: {
                text: '业绩报表'
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            legend: {},
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: {
                type: 'category',
                data: ['周一', '周二', '周三', '周四']
            },
            yAxis: {
                type: 'value',
                boundaryGap: [0, 0.01]
            },
            series: [
                {//里层的柱子
                    name: '销售部A组',
                    type: 'pictorialBar',//象形柱状图
                    // emphasis: { focus: 'self' },
                    barWidth: 40,//柱子的宽度
                    data: [72, 79, 70, 67],//柱子的数据
                    symbolOffset: [-30, 0],//柱子的位置
                    symbol: 'rect',//柱子的形状
                    // symbolRepeat: true,//是否重复
                    // symbolBoundingData: 1,//图形的个数
                    z: 12//柱子的层级
                },
                { //外层的柱子
                    name: "销售部B组",
                    type: "pictorialBar",
                    // emphasis: { focus: 'self' },
                    barWidth: 50,
                    //symbolSize: [40, 18], //调整截面形状
                    symbolOffset: [-35, 0],
                    symbol: 'rect',
                    // symbolRepeat: true,
                    // symbolBoundingData: 1,
                    itemStyle: {
                        color: ''
                    },
                    data: [82, 89, 90, 97]
                },
                
            ]
        };

        // 应用配置
        myChart.setOption(option);


        // 响应窗口大小变化
        window.addEventListener('resize', function () {
            myChart.resize();
        });
    </script>
</body>

</html>